package com.qingcheng.dao;

import com.qingcheng.pojo.system.Resource;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface ResourceMapper extends Mapper<Resource> {
    @Select("SELECT res_key from tb_resource where id in\n" +
            "(SELECT resource_id from tb_role_resource where role_id in \n" +
            "\t(SELECT role_id from tb_admin_role where admin_id =\n" +
            "\t\t(SELECT id from tb_admin WHERE login_name = #{loginName}\n" +
            "\t\t)\n" +
            "\t)\n" +
            ")")
    public List<String> selectResKeyByAdmin(@Param("loginName") String loginName);

}
